#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>
#include <QTimer>

QT_BEGIN_NAMESPACE
namespace Ui { class Dialog; }
QT_END_NAMESPACE

class Dialog : public QDialog
{
    Q_OBJECT

public:
    void resetCurrentSeconds();
    bool isZero = false;
    void setBackgroundColor(const QString);
    QPointF distance;
    bool isStart;
    bool isDrag;
    bool isCountdown;
    bool again;
    int expectedSeconds;
    int currentSeconds;
    Dialog(QWidget *parent = nullptr);
    void connectSlot();
    ~Dialog() override;
    //鼠标按下
    void mousePressEvent(QMouseEvent *e) override;
    //鼠标移动
    void mouseMoveEvent(QMouseEvent *e) override;
    //鼠标释放
    void mouseReleaseEvent(QMouseEvent *e) override;
    void warn(QWidget*);
    void succ(QWidget*);
    void showStart();
    void showStop();
    void initUi();
 public slots:
    void updateNumber();
    void updateSeconds();
    void switchStart();
    void switchDirection();
    void modifyExpectedSeconds(int seconds);
    void switchLoop();
    void restart();
private:
    Ui::Dialog *ui;
    QTimer* timer;
};
#endif // DIALOG_H
